package com.atguigu.coupon.coupons.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.common.utils.Query;

import com.atguigu.coupon.coupons.dao.SmsSeckillSkuRelationDao;
import com.atguigu.coupon.coupons.entity.SmsSeckillSkuRelationEntity;
import com.atguigu.coupon.coupons.service.SmsSeckillSkuRelationService;


@Service("smsSeckillSkuRelationService")
public class SmsSeckillSkuRelationServiceImpl extends ServiceImpl<SmsSeckillSkuRelationDao, SmsSeckillSkuRelationEntity> implements SmsSeckillSkuRelationService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<SmsSeckillSkuRelationEntity> wapper = new QueryWrapper<>();
        //查询指定场次关联的商品
        String str = (String) params.get("promotionSessionId");
        if(str!=null){
            wapper.eq("promotion_session_id",str);
        }
        IPage<SmsSeckillSkuRelationEntity> page = this.page(
                new Query<SmsSeckillSkuRelationEntity>().getPage(params),wapper

        );

        return new PageUtils(page);
    }

}